import java.util.Scanner;

/**
 * @Author: YCKOKO
 * @Date: 2023-05-12
 * @Time:11:17
 * @Description:
 */
public class demo1 {
//    public static boolean isHuiWen(String s){
//        String temp = s;
//        int start = 0;
//        int end = temp.length()-1;
//        while(start < end){
//            char ch = temp.charAt(start);
//            temp = temp.replace(temp.charAt(start),temp.charAt(end));
//            temp = temp.replace(temp.charAt(end),ch);
//            start++;end--;
//        }
//        if(temp.equals(s)){
//            return true;
//        }
//        return false;
//    }

    public static boolean isHuiWen(String s){
        String temp = s;
        StringBuffer sb = new StringBuffer(temp);
        sb.reverse();
        String reverseStr = sb.toString();
        if(reverseStr.equals(s)){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        String temp = "abcdef";
        StringBuffer sb = new StringBuffer(temp);
        System.out.println(sb);
        sb.reverse();
        System.out.println(sb);
        String reverseStr = sb.toString();
        System.out.println(reverseStr);
    }

    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s1 = scan.nextLine();
        String s2 = scan.nextLine();

        int count = 0;
        String[] str = new String[s1.length()+1];

        for (int i = 0; i < str.length; i++) {
            str[i] = s1.substring(0,i) + s2 + s1.substring(i);
        }

        for (String s :str) {
            if(isHuiWen(s)){
                count++;
            }
        }

        System.out.println(count);
    }
}
